<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
	<!--<![endif]-->
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>收款记录</title>
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />

		<meta content="telephone=no" name="format-detection" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />

		<!-- 引入样式 -->
		<link rel="stylesheet" href="../styles/vant.css">
		<link rel="stylesheet" href="../styles/common.css" />
		<link rel="stylesheet" href="../styles/global.css" />
		<link rel="stylesheet" href="../styles/login.css" />
		<link rel="stylesheet" href="../styles/font.css">
		<!-- 引入组件 -->
		<script src="../scripts/babel.js" type="text/javascript" charset="utf-8"></script>
		<script src="../scripts/rem.js"></script>
		<script src="../scripts/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="../scripts/vant.js"></script>
		<script src="../scripts/api.js" type="text/javascript" charset="utf-8"></script>
		<script src="../scripts/axios.js" charset="utf-8"></script>

	</head>
	<body>
		<!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
		<div class="container" id="app">
			<div class="header">
				<div  @click="go_back"><span><i class="iconfont icon-back"></i></span></div>
				<div>交易明细</div>
				<div class="headericon"></div>
			</div>

			<div class="money">
				<div class="m_l">
					金额
				</div>
				<div class="m_r" v-text="data_info.paymentamt+'元'">					
				</div>
			</div>
			<div class="details">
				<div class="d_main">
					<span>一卡通订单号</span>
					<s v-text="data_info.cartoonorderid"></s>
				</div>
				<div class="d_main">
					<span>商户订单号</span>
					<s v-text="data_info.outtradeno"></s>
				</div>
				<div class="d_main">
					<span>消费者名字</span>
					<s v-text="data_info.username"></s>
				</div>
				<div class="d_main">
					<span>支付时间</span>
					<s v-text="data_info.paydate"></s>
				</div>
				<div class="d_main">
					<span>状态</span>
					<s v-text="data_info.billstatus"></s>
				</div>
				<div class="d_main">
					<span>方式</span>
					<s v-text="data_info.type"></s>
				</div>
				<div class="d_main">
					<span>备注</span>
					<s v-text="data_info.body"></s>
				</div>
			</div>
		</div>
	</body>
	<style type="text/css">
		.money {
			margin-top: 0.95rem;
			display: flex;
			justify-content: space-between;
			flex-wrap: nowrap;
			height: 1.71rem;
			border-bottom: 1px solid #b9b9b9;
		}

		.money .m_l {
			font: 0.40rem/1.71rem "";
			margin-left: 0.34rem;
			color: #818181;
		}

		.money .m_r {
			font: 0.76rem/1.71rem "";
			margin-right: 0.34rem;
			color: #010101;
		}

		.details {
			border-bottom: 1px solid #b9b9b9;
			padding: 0.41rem 0;
		}

		.details .d_main {
			width: 90%;
			margin: 0 auto;
			display: flex;
			justify-content: space-between;
			flex-wrap: nowrap;
		}

		.details .d_main span {
			font: 0.25rem/0.57rem "";
			color: #818181;
		}

		.details .d_main s {
			font: 0.25rem/0.57rem "";
			text-decoration: none;
			color: #010101;
		}
	</style>
	<script type="text/babel">
		new Vue({
			el: '#app',
			data: {
				url: "",
				userId: "",
				token: "",
				admin: "",
				data_info:{},
				cartoonorderid:""
			},
			
			mounted: function() {
				this.url = url();
				this.admin = JSON.parse(localStorage.getItem("admin"));
				if (!this.admin) {
					this.$notify("非法登录，请重新登陆");
					setTimeout(this.go_login, 2000);
					return
				}
				this.userId = this.admin.mid;
				this.token = this.admin.token;
				var value= window.location.search;	
				this.cartoonorderid=value.substr(1);
				this.selectMchOrderInfo()				
			},			
			methods: {	
				go_back: function() {
					window.history.back(-1);
				},
				// 消费明细/mchapp/info/selectMchOrderInfo
				selectMchOrderInfo: function() {
					
					var that = this;
					var data = {
						userId: that.userId,
						token: that.token,
						requestString: JSON.stringify({
							cartoonorderid: that.cartoonorderid,							
						})
					}
					console.log(data)
					this.loading=true;
					axios.post(that.url + '/mchapp/info/selectMchOrderInfo', data).then(function(response) {							
							if (response.data.code == 200) {
								that.data_info = response.data.returnString;
								if(that.data_info.billstatus==1){
									that.data_info.billstatus ="已完成 "
								}
								if(that.data_info.billstatus==2){
									that.data_info.billstatus ="已退款 "
								}
								if(that.data_info.type==0){
									that.data_info.type ="商户下单 "
								}
								if(that.data_info.type==1){
									that.data_info.type ="扫码 "
								}
							}//判断单点登录
							else if(response.data.code == 300){
								that.$notify("账号在别处登录，将为您返回登录页面");//							
								if(that.admin.teltype==1){
									logout_app(that.admin.mid,1)
								}
								if(that.admin.teltype==2){
									logout_app(that.admin.mid,2)
								}							
							}  else {
								that.$notify(response.data.disp);
							}
						})
				
				},
			},

		})
	</script>

</html>
